﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using myschoolDal;

namespace school
{
    public partial class manshowmanagerinformation : Form
    {
        private string name;
        private long ID;

        public manshowmanagerinformation()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox2.Text == "")
            {
                MessageBox.Show("错误：" + bug.Class1.worng4001, "提示");
            }
            else
            {
                name = textBox2.Text.ToString();
                manserver.ManChangeManInformation_Name(ID, name);
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (textBox9.Text == "")
            {
                MessageBox.Show("错误：" + bug.Class1.worng4001, "提示");
            }
            else
            {
                ID = Convert.ToInt64(textBox9.Text);
                if (manserver.CheckId(ID))
                {
                    dataGridView1.DataSource = manserver.GetManInformation(ID).Tables[0].DefaultView;
                }
                else
                {
                    dataGridView1.DataSource = null;
                }

            }
        }
    }
}
